package vashion.azeroth.core.api.request;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import vashion.azeroth.core.api.response.AddItemResponse;
import vashion.azeroth.core.api.service.ApiItemService;
import vashion.azeroth.core.api.service.impl.ApiItemServiceImpl;

public class ApiTest {

	public static void main(String[] args) {

		// AddOrderRequest orderRequest = new AddOrderRequest();
		//
		// orderRequest.setCod_fee(333d);
		//
		// String json = orderRequest.buildJson();
		//
		// System.out.println(orderRequest.buildJson());
		//
		// String res = HttpRestRequest.exec(json);
		//
		// AddOrderResponse aor = JSON.parseObject(res, AddOrderResponse.class);
		//
		// System.out.println(ToStringBuilder.reflectionToString(aor,
		// ToStringStyle.MULTI_LINE_STYLE));

		System.out.println("------------------------------");

		ApiItemService ais = new ApiItemServiceImpl();

		AddItemRequest item = new AddItemRequest();

		item.setCode("test");

		List<Sku> skus = new ArrayList<Sku>();

		Sku sku = new Sku();

		sku.setSkuCode("sku_code");
		sku.setSkuName("skuname");

		skus.add(sku);

		item.setSkus(skus);

		AddItemResponse re = ais.addItem(item);

		System.out.println(ToStringBuilder.reflectionToString(re,
				ToStringStyle.MULTI_LINE_STYLE));

	}

}
